<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const user = {
        username: 'jack',
        age: 20,
        gender: 'boy',
        flag: undefined,
        say: function () {},
        [Symbol('id')]: 100,
        cid: Symbol('cid'),
      };
      //JSON格式的字符串： 双引号，属性加引号，去掉最后一个逗号
      console.log(JSON.stringify(user)); //{"username":"jack","age":20,"gender":"boy"}
    </script>
  </body>
</html>
